#include <algorithm>
#include <cstdio>
#include <cstring>

const int N = 1e5 + 5;
int n, l, a[N], b[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("river.in", "r", stdin);
  freopen("river.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &l);
  for (int i = 1; i < n; ++i) scanf("%d", &a[i]), b[0] += a[i];
  a[n] = b[0];
  for (int i = 0; i < n; ++i) {
    for (int j = std::min(n, i + l); j > i; --j) {
      if (b[j] < a[j]) {
        if (b[j] + b[i] <= a[j]) {
          b[j] += b[i], b[i] = 0;
          break;
        } else {
          b[i] -= a[j] - b[j];
          b[j] = a[j];
        }
      }
    }
  }
  printf("%d", b[n]);
  return 0;
}